package com.apartment.own.service.impl;

import java.util.List;
import com.apartment.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.apartment.own.mapper.OwnOuUserMapper;
import com.apartment.own.domain.OwnOuUser;
import com.apartment.own.service.IOwnOuUserService;

/**
 * 普通用户Service业务层处理
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Service
public class OwnOuUserServiceImpl implements IOwnOuUserService 
{
    @Autowired
    private OwnOuUserMapper ownOuUserMapper;

    /**
     * 查询普通用户
     * 
     * @param id 普通用户ID
     * @return 普通用户
     */
    @Override
    public OwnOuUser selectOwnOuUserById(Long id)
    {
        return ownOuUserMapper.selectOwnOuUserById(id);
    }

    /**
     * 查询普通用户列表
     * 
     * @param ownOuUser 普通用户
     * @return 普通用户
     */
    @Override
    public List<OwnOuUser> selectOwnOuUserList(OwnOuUser ownOuUser)
    {
        return ownOuUserMapper.selectOwnOuUserList(ownOuUser);
    }

    /**
     * 新增普通用户
     * 
     * @param ownOuUser 普通用户
     * @return 结果
     */
    @Override
    public int insertOwnOuUser(OwnOuUser ownOuUser)
    {
        ownOuUser.setCreateTime(DateUtils.getNowDate());
        return ownOuUserMapper.insertOwnOuUser(ownOuUser);
    }

    /**
     * 修改普通用户
     * 
     * @param ownOuUser 普通用户
     * @return 结果
     */
    @Override
    public int updateOwnOuUser(OwnOuUser ownOuUser)
    {
        ownOuUser.setUpdateTime(DateUtils.getNowDate());
        return ownOuUserMapper.updateOwnOuUser(ownOuUser);
    }

    /**
     * 批量删除普通用户
     * 
     * @param ids 需要删除的普通用户ID
     * @return 结果
     */
    @Override
    public int deleteOwnOuUserByIds(Long[] ids)
    {
        return ownOuUserMapper.deleteOwnOuUserByIds(ids);
    }

    /**
     * 删除普通用户信息
     * 
     * @param id 普通用户ID
     * @return 结果
     */
    @Override
    public int deleteOwnOuUserById(Long id)
    {
        return ownOuUserMapper.deleteOwnOuUserById(id);
    }
}
